/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package acceso_datos;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Pablo
 */
public class ConexionDB {

    private static ConexionDB INSTANCE = null;
    
    private Connection conn;
    private Statement statement;
    

    public ConexionDB() {
        String url = "jdbc:postgresql://localhost:5432/sistema_ecu911";          
        String driver = "org.postgresql.Driver";
        String userName = "postgres";
        String password = "lithium";
        try {
            Class.forName(driver);
            this.conn = (Connection)DriverManager.getConnection(url,userName,password);
        }catch (Exception sqle) {
            sqle.printStackTrace();
        }
    }

    public static synchronized ConexionDB getINSTANCE() {
        if (null == INSTANCE) {
            INSTANCE = new ConexionDB();
        }
        return INSTANCE;
    }

    /**
     * @return the conn
     */
    public Connection getConnection() {
        return conn;
    }
   

    
}
